Skip to content

Port Microsoft.Extensions.AI.AzureAIInference to Azure.AI.Inference #50097

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

@Copilot Copilot AI review requested due to automatic review settings May 15, 2025 18:23
@github-actions github-actions bot added AI Model Inference AI Projects Community Contribution Community members are working on the issue customer-reported Issues that are reported by GitHub users external to the Azure organization. labels May 15, 2025
Copy link

Thank you for your contribution @jozkee! We will review the pull request and get back to you soon.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR ports Microsoft.Extensions.AI.AzureAIInference into the Azure.AI.Inference namespace and updates associated tests and clients. Key changes include:

  • Adding test utilities (e.g. VerbatimHttpHandler) and comprehensive tests for image and text embedding generators.
  • Updating project files with new package references and embedded resources.
  • Implementing new client wrappers and extension methods to expose endpoints and generate embeddings via ImageEmbeddingsClient, EmbeddingsClient, and ChatCompletionsClient.

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
sdk/ai/Azure.AI.Inference/tests/Utilities/VerbatimHttpHandler.cs Added a custom HttpMessageHandler for request/response validation in tests.
sdk/ai/Azure.AI.Inference/tests/AzureAIInferenceImageEmbeddingGeneratorTests.cs Introduced tests for image embedding generation and validated response metadata.
sdk/ai/Azure.AI.Inference/tests/AzureAIInferenceEmbeddingGeneratorTests.cs Added tests for text embedding generation including usage metrics validation.
sdk/ai/Azure.AI.Inference/tests/Azure.AI.Inference.Tests.csproj Updated project references and embedded resource configuration.
sdk/ai/Azure.AI.Inference/src/Customized/*.cs Added clients, extension methods, and generator implementations to wrap Azure.AI.Inference functionality.
eng/Packages.Data.props Updated package references for integrations with AI and caching abstractions.


foreach (Embedding<float> e in response)
{
Assert.That(e.ModelId, Is.EqualTo("embed-v4.0"));
Copy link
Preview

Copilot AI May 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test constructs the generator with a default model ID of 'embed-v-4-0' yet later asserts the produced ModelId is 'embed-v4.0'. If this conversion is intentional, please document the transformation for clarity; otherwise, consider aligning the model naming consistently.

Copilot uses AI. Check for mistakes.

Copy link

github-actions bot commented May 15, 2025

API Change Check

APIView identified API level changes in this PR and created the following API reviews

Azure.AI.Inference

Copy link
Member

@jsquire jsquire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General conventions and repo-level changes look good. I don't have enough understanding of the extensions themselves to offer deeper thoughts there, so I'll defer to @jeffhandley's judgement.

When you feel confident that things are in good shape, yell and I'll get this merged.

@jeffhandley
Copy link

Thanks, @jsquire. It's ready to merge. :-)

@jeffhandley
Copy link

Augmenting that comment, @jsquire: it's ready from my perspective. Up to you if you'd like to wait for a review from @dargilco and/or @trangevi before merging. Thanks for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AI Model Inference AI Projects Community Contribution Community members are working on the issue customer-reported Issues that are reported by GitHub users external to the Azure organization.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants